//
//  TestLogicPosition.m
//  HeroNuts
//
//  Created by Magic on 11-5-9.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "TestLogicPosition.h"


@implementation TestLogicPosition

#if USE_APPLICATION_UNIT_TEST     // all code under test is in the iPhone Application

- (void) testAppDelegate {
    
    id yourApplicationDelegate = [[UIApplication sharedApplication] delegate];
    STAssertNotNil(yourApplicationDelegate, @"UIApplication failed to find the AppDelegate");
    
}

#else                           // all code under test must be linked into the Unit Test bundle

- (void) setUp
{
	p1 = [[HNLogicPosition alloc] init];
	p2 = [[HNLogicPosition alloc] init];	
	
}

- (void) tearDown
{
	[p1 release];
	[p2 release];
}

- (void) test1
{
	
	
    CGPoint dis = [HNLogicPosition distanceInPixelsFrom:CGPointMake(0, 0) to:CGPointMake(1, 0)];
	
    STAssertTrue(dis.x == 44 && dis.y == 0,@"wrong distance");

}

/*
- (void) test2
{
	p1.position = CGPointMake(0, 0);
	
	p2.position = CGPointMake(0, 1);
	
	CGPoint dis = [HNLogicPosition distanceFrom:p1 to:p2];
	
	STAssertTrue(dis.x == -22 && dis.y == 45,@"wrong distance");
		
}

- (void) test3
{
	p1.position = CGPointMake(0, 0);
	
	p2.position = CGPointMake(1, 1);
	
	CGPoint dis = [HNLogicPosition distanceFrom:p1 to:p2];
	
	STAssertTrue(dis.x == 22 && dis.y == 45,@"wrong distance");
	
}

- (void) test4
{
	p1.position = CGPointMake(0, 0);
	
	p2.position = CGPointMake(2, 1);
	
	CGPoint dis = [HNLogicPosition distanceFrom:p1 to:p2];
	
	STAssertTrue(dis.x == 66 && dis.y == 45,@"wrong distance");
	
}

- (void) test5
{
	p1.position = CGPointMake(2, 2);
	
	p2.position = CGPointMake(0, 0);
	
	CGPoint dis = [HNLogicPosition distanceFrom:p1 to:p2];
	
	STAssertTrue(dis.x == -88 && dis.y == -90,@"wrong distance");
	
}

- (void) testMath {
    
    STAssertTrue((1+1)==2, @"Compiler isn't feeling well today :-(" );
    
}

*/
#endif


@end
